<?php

namespace App\Repository\Models;

use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;

/**
 * Class OrderQualification.
 *
 * @package namespace App\Repository\Models;
 */
class OrderQualification extends Model implements Transformable
{
    use TransformableTrait;

    protected $table = 'order_qualification';
    protected $fillable = ['id','order_code','shop_id','user_id','bid_date','project_name','project_inf','appendix','invoce_id','status','remark'];
    
    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }
    
    public function shop()
    {
        return $this->hasOne(Shop::class, 'sp_id', 'shop_id');
    }
    
    public function service_detail()
    {
        return $this->hasMany(OrderQualificationDetail::class, 'bid_id', 'id');
    }


}
